package com.three.controller;

import com.three.aop.LogAnotation;
import com.three.entity.Shaftchoose;
import com.three.service.ShaftChooseService;
import com.three.vo.R;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/shaftchoose")
public class ShaftChooseController {
    @Autowired
    private ShaftChooseService shaftChooseService;

    @GetMapping("/list")
    public R getShaftChoose(){
        return shaftChooseService.list();
    }

   //获取所有
    @PostMapping("/shaftchooselist")
    public R getShaftChooseAll(Integer pageNum, Integer pageSize, @RequestBody Shaftchoose shaftchooses){
        return shaftChooseService.getShaftChooseAll( pageNum ,pageSize ,shaftchooses);
    }

    //添加
    @PostMapping("/addShaftchoose")
    @LogAnotation(value = "添加轴体选择")
    public R add(@RequestBody Shaftchoose shaftchoose){
        return shaftChooseService.add(shaftchoose);
    }

    //编辑
    @PostMapping("/editShaftchooseAll")
    @LogAnotation(value = "编辑轴体选择")
    public R edit(@RequestBody Shaftchoose shaftchoose){
        return shaftChooseService.edit(shaftchoose);
    }

    //删除
    @DeleteMapping("/deleteshaftchoose")
    @LogAnotation(value = "删除轴体选择")
    public R delete(Integer shaftchooseid){
        return shaftChooseService.delete(shaftchooseid);
    }

}
